package com.cinc.ebc.mm.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cinc.ebc.mm.entity.MmPurchaseRequisition;
import com.cinc.ebc.mm.entity.MmPurchaseRequisitionDetail;
import com.cinc.ebc.mm.model.MmPurchaseRequisitionDetailModel;
import com.cinc.ebc.mm.vo.MmPurchaseRequisitionDetailPage;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @Description: 采购申请
 * @Author: jeecg-boot
 * @Date:   2022-03-20
 * @Version: V1.0
 */
public interface IMmPurchaseRequisitionService extends IService<MmPurchaseRequisition> {

	/**
	 * 添加一对多
	 *
	 */
	public void saveMain(MmPurchaseRequisition mmPurchaseRequisition,List<MmPurchaseRequisitionDetail> mmPurchaseRequisitionDetailList) ;

	/**
	 * 修改一对多
	 *
	 */
	public void updateMain(MmPurchaseRequisition mmPurchaseRequisition,List<MmPurchaseRequisitionDetail> mmPurchaseRequisitionDetailList);

	/**
	 * 删除一对多
	 */
	public void delMain (String id);

	/**
	 * 批量删除一对多
	 */
	public void delBatchMain (Collection<? extends Serializable> idList);

	/**
	 * 明细分页查询
	 *
	 * @param page
	 * @param mmPurchaseRequisitionDetailPage
	 * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.cinc.ebc.modules.mm.model.MmPurchaseRequisitionDetailModel>
	 * @throws
	 */
	IPage<MmPurchaseRequisitionDetailModel> detailPage(IPage<MmPurchaseRequisitionDetailModel> page, MmPurchaseRequisitionDetailPage mmPurchaseRequisitionDetailPage);

	/**
	 * 明细列表查询
	 *
	 * @param mmPurchaseRequisitionDetailPage
	 * @return void
	 * @throws
	 */
    List<MmPurchaseRequisitionDetailModel> detailList(MmPurchaseRequisitionDetailPage mmPurchaseRequisitionDetailPage);

    /**
     * 删除明细
     *
     * @param id
     * @return void
     * @throws
     */
	void delDetail(String id) throws Exception;

	void delBatchDetail(List<String> idList) throws Exception;

	void autoUpdateStatus(List<String> idList);
}
